import { createStore } from 'vuex'

import createPersistedstate from 'vuex-persistedstate'

export default createStore({
  state: {
    recordData: [],

  },
  getters: {
  },
  mutations: {
    add(state, recording) {
      state.recordData.unshift(recording)
    },
    del(state,recording) {
      // for(item in recording) {
        state.recordData = recording.splice(0,state.recordData.length)
      // }
        state.recordData = []
    }
  },
  plugins: [createPersistedstate({
    storage: window.sessionStorage
  })],
  actions: {
  },
  modules: {
  }
})
